home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AOL File Library: 4,101 to 4,200
/
aol-file-protocol-4400-4101-to-4200.zip
/
AOLDLs
/
ADV - Articles & Misc
/
Manual for ProDev DDT8_DDT16
/
DDT.MANUAL.bxy
/
DDT.Manual
/
CHAPTER.4
(
.txt
)
< prev
next >
Wrap
AppleWorks Document
|
1993-08-05
|
14KB
|
246 lines
O=====<====<====<====<====<====<====<====<====<====<====<====<====<====<====<===
O=====<====<====<====<====<====<====<====<====<====<====<====<====<====<====<===
card as bank 1.the ProDev DDT displays the lowest bank
CHAPTER 4
BREAK POINTS
SB [T A.N] - SET BREAK POINT
JBreak points work like stop signs in the target program. By strategically L
Jplacing break points you can determine many things about the logical flow E
Ca program follows. Break points must be placed at EXACTLY the same J
Haddress as the first byte of the instruction where you want the program &
to stop. (see the following example)
TYPES OF BREAKS
BThe ProDev DDT has two types of software break points, "Real" and K
I"Implied". There is also a hardware break point, "Hard Break", that will
be described later.
DA Real break inserts "BRK" (break, HEX 00) commands in place of any $
instruction that is in RAM memory.
DThe Implied break does not modify your program. This allows Implied L
Jbreaks to be used in ROM locations or write protected RAM. Implied breaks K
Iare ONLY affective when STepping, TRacing or EXecuting code and will not /
stop a program if it is running in real time.
The form of the Set Break instruction is:
SB [ Type Address . Number ]
IWhere Type is input as "R" for Real break or "I" for Implied break. Type )
"R" is assumed if no Type is indicated.
EAddress is any Hex number or decimal equivalent. Bank numbers may be 0
specified and must be followed by a "/" slash.
INumber is any Hex or decimal number in the range of $0001 to $FFFF. This I
Gis the number of times to pass this breakpoint before stopping program I
Gexecution. Entering $0000 will result in passing the breakpoint 65,536 J
Htimes. Therefore, the actual range is 1 to 65,536 or $0001 to $0000 but L
Jthat looks weird. If no value is input for Number then the default of "1"
will be assumed.
?If you specify a break where one already exists, the new break #
information will replace the old.
JEntering "SB<cr>" will provide a list of the current SOFT BREAKS, if any. H
FThe break points are listed in the order last accessed, with the most I
Grecent being at the top left of the display. This command is primarily I
Gintended for use with a serial terminal but is also useful if you have G
entered more breakpoints than can be displayed in the "Break Window".
EA maximum of 50 breakpoints is allowed at any one time. The ten most K
Irecently accessed breakpoints are displayed in the "Break Window" of the #
ProDev DDT's main display screen.
EXAMPLE
SB I 800.1
G Sets an Implied break at location $800 in the current bank and will (
stop the first time it is encountered.
SB R 1/0900.3
F Sets a Real break at location $900 in bank 1 {DDT8 aux memory} and -
will stop the third time it is encountered.
SB R 03/2345.!200
G Sets a Real break at location $2345 in bank
3 {DDT8 aux memory} and )
will stop after decimal 200 encounters.
SB 2003
I Sets a Real break at location $2003 in the current bank and will stop #
the first time it is encountered.
EXAMPLE
Stop the program below when the "JMP 3000" instruction is reached.
00/2000: A9 A0 LDA #A0#
00/2002: 20 ED FD JSR FDED#
00/2005: 4C 00 30 JMP 3000
FWe will use a Real Type breakpoint so the program will be interrupted E
Cfrom running in real time. We also want to stop the first time the E
breakpoint is encountered. The following will place the breakpoint:
:SB R 0/2005.1
:SB 2005
{ assumes bank 0 is current default
The new breakpoint should appear in Window #4, the Break Window.
{Now run the program.}
:GO 2000
{ start running program in real time
IWhen the Breakpoint is reached the program is halted and the processor's ,
registers are displayed as follows {DDT8}.
BREAKPOINTA
A=A0 X=00 Y=FF S=FB M=0A L=0 P=N-1-----
{ registers may vary
00/2005:4C 00 30 JMP 3000
ENote! The word "BREAKPOINT" was displayed, indicating the ProDev DDT 2
stopped the program execution with a Breakpoint.
***** HOW IT WORKS *****
JWhen you enter a Breakpoint, the ProDev DDT saves the current instruction J
Hto its own internal memory and replaces the instruction byte with a BRK L
Jcommand (HEX 00). Then it waits for a BRK command to be executed. When it K
Isees one, it checks to see if it is a break that you have entered. If it L
is, the ProDev DDT stops the program and gives you control. However, when
Git displays the instruction, it displays the original instruction byte >
and not the BRK command which really occupies that location.
CWhen the "GO" command is used to run a program and a Real Break is H
Fencountered, the program is stopped, the DISPLAY REGISTERS command is K
Iautomatically executed, and you are returned to the ProDev DDT's command
level.
***** MOVING CODE & BREAKPOINTS *****
HCaution!!! If a section of code containing Real Breaks is relocated the H
FProDev DDT will not recognize the Breaks and undesirable results will
occur.
HIf part of a program containing Real Breaks is overwritten by new code, K
Ithe ProDev DDT will not know about it. If you then proceed to remove the K
IReal Breaks the existing code will be overwritten by the contents of the
original breakpoint location.
CONDITIONAL BREAKPOINTS
{DDT16}
EConditional breakpoints extend the function of normal breakpoints by I
Gallowing you to use the contents of the processor's registers as break 3
conditions. The command takes the following form:
SB C $01/2345 , X = $6789
^ ^^^^^^^ ^ ^ ^^^^E
|_____|______|_|___|____ Indicates a conditional breakpoint8
|______|_|___|____ Address of breakpoint:
|_|___|____ Register for comparison3
|___|____ Logical operator?
|____ Value to compare to register
IThis example would cause a break at location $01/2345 if the contents of &
the "X" register was equal to $6789.
The registers that may be used for comparison are:
A,X,Y,S,D,B,M,Q and P.
The allowable logical operators are:
less than"
greater than
equal
not equal(
less than OR equal+
greater than OR equal
IAll comparisons are done in full 16 bit native mode. 8 bit registers are 2
compared to the low byte of the comparison word.
DConditional breakpoints modify the target program the same way Real J
breakpoints do and therefore they may not be used in ROM code locations.
HThe purpose for adding this feature was to allow breaking on particular G
Etool calls. Tool calls are made by placing a two-byte value in the X I
Gregister that identifies the tool set and the command value to use and K
Ithen doing a JSL to the common tool entry point at $E1/0000. To break on I
Ga particular tool call we simply determine the value of the X register K
Ithat corresponds to the desired tool to break on and place a conditional K
Ibreak point at location $E1/0000. The following statement would break on
a TLShutDown tool call:
SB C $E1/0000,X=0301
RB A - REMOVE BREAK
EThe REMOVE BREAK command allows you to remove any of the Breakpoints H
Fwhich you have entered. The address is mandatory, as indicated by the J
Hfact that the letter "A" is not enclosed in brackets. When you remove a K
IBreakpoint the original instruction is fully restored and the address is '
removed from the list of Breakpoints.
EXAMPLE
Remove the Breakpoint from address $2005
:RB 0/2005
or
:RB 2005
HB [A] - HARD BREAK
JThe HARD BREAK command appears very similar to the Set Break command. The I
Gcommand actually activates the one hardware Stop-On-Address the ProDev G
EDDT is equipped with. Omitting the optional address will result in a L
Jdisplay of the current HARD BREAK address. When activated, the ProDev DDT K
Iwatches the addresses that are being accessed by the processor. It stops G
the target program when it sees the specified address being accessed.
FThe Hardware Break may be used as a real time breakpoint for programs I
Gthat are running from read only memory (ROM). This command may also be F
Dused to monitor any memory location and stop your program when that K
Ilocation is accessed. For example, if a certain memory location is being G
Emodified and you wish to find out which instructions are causing the J
Hmodification, you simply use the HARD BREAK command to stop the program '
when the memory location is accessed.
JThe bank address specified in the Hard Break address is not actually used L
Jin the DDT's hardware comparator. This is because the DDT's comparator is K
Ionly able to compare 16 bits at once. The comparison of the bank address F
Dis done in software by looking at the target programs 'program' and L
J'bank' registers. If no match is found the Hard Break is ignored. You can I
Gtell the DDT to ignore bank addresses when doing a Hard Break by using
the HBX command:
HBX address
GThis will place a Hard Break at the specified address and will stop in G
all banks, not just the current program or data bank. The command is
Duseful if your program is being stepped on and you want to find the I
Goffending instruction. The normal Hard Break would usually work unless I
Gthe offending instruction is a 'long indirect' addressing type such as I
GSTA [aa]. In this case the destination bank address is not the current D
Bprogram or data bank and the normal Hard Break would not stop the
program.
BIf you enter the command correctly the Breakpoint display will be #
address instead of HB address.
EXAMPLE Used as a real time ROM breakpoint.
JLet's assume the following program resides in ROM and you wish to place a )
real time breakpoint at location $FDB5.
00/FDB3 A5 3C LDA 3C
00/FDB5 09 07 ORA #07
00/FDB7 85 3E STA 3E
Place the Hard Break with the following command:
:HB 0/FDB5
JThe Break Window should display the new Hard Break location in the top of
the window as "H00/FDB5".
HNow if you run the program the Hard Break will interrupt execution when 2
$FDB5 is reached and will display the following.
HARD BREAK@
A=07 X=00 Y=00 S=F4 M=0A L=0 P=--1B----
{ contents may vary
00/FDB7:85 3E STA 3E
HNote! The address displayed is $FDB7 and not $FDB5 where you placed the D
BHard Break. This assumes you started the program running prior to K
Ilocation $FDB3. This is normal operation. One or two addresses following F
Dthe selected Break location is displayed because of the way the CPU
handles interrupts.
***** ADVANCED EXPLANATION *****
EWhen the ProDev DDT sees the address $FDB5 it sends the processor an J
Hinterrupt. However, the processor does not stop program execution until L
Jit has finished the instruction that it is currently working on. Which in B
@this case is "ORA #$07". The processor completes the "ORA #$07" I
Ginstruction and then gives control over to the ProDev DDT which is why L
Jthe address displayed by a HARD BREAK is the instruction or two following "
the actual address of the BREAK.
EXAMPLE memory location being changed
GMemory location $21 is being changed when you run your program and you G
Ewish to know which instructions are responsible. Simply use the HARD
BREAK feature as follows:
:HBX 0/21 or :HBX 21
IWhen you run your program and location $21 is accessed your program will K
Ibe stopped at the instructions following the one which accessed location I
G$21. If you wish to check for any other instructions which also access G
Elocation $21, simply enter the "GO" command to continue running your H
Fprogram. If any other instructions access location $21 they will also +
cause the HARD BREAK to stop the program.
RH - REMOVE HARD BREAK
DThe REMOVE HARD BREAK command allows you to remove the current HARD H
BREAK. An address is not required, since there is only one HARD BREAK.
RA - REMOVE ALL BREAKS
EThe REMOVE ALL BREAKS command allows you to remove all existing SOFT 1
BREAKS and the one HARD BREAK with one command.
EXAMPLE
To remove all existing BREAKS simply enter the following:
The BUTTON INTERRUPT
JThe BUTTON INTERRUPT gives you access to the NMI (non-maskable interrupt) I
Gline through the ProDev DDT card. This allows you to regain control of I
Gprograms that are running in real time or of programs that are running J
Hout of control. The BUTTON INTERRUPT will not work until the ProDev DDT 8
card has been initialized following a system power up.
IThe hardware on the DDT card generates an NMI to interrupt the currently
running program.
{DDT16}J
HThe DDT uses the NMI vector at $03FB to redirect program control to the K
IDDT. This vector is set when you initialize the DDT. If this vector gets J
Hchanged after the DDT has initialized it, the button interrupt will not G
Eget vectored to the DDT and will cause bad things to happen. Booting K
IProDOS 8 is one way to change the $03FB vector. Always try to initialize 7
the DDT just prior to using it to avoid this problem.
{DDT8}L
JThe DDT uses hardware to disable the Apple //e's ROMs and take control of G
the NMI handler. It is possible to interrupt any program at any time.